@extends('admin.public.base')


@section('title', '订单管理')


@section('content')

    @if(session('status'))
        <script>
            setTimeout(() => {
                layer.msg("{{session('status')}}");
            }, 100)
        </script>
    @endif

    <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
        <span class="c-gray en">&gt;</span>
        订单管理
        <span class="c-gray en">&gt;</span>
        订单列表
        <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
           href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
    </nav>
    <div class="Hui-article">
        <article class="cl pd-20">
            <div class="text-c">
                <form action="" method="get">
                    <span class="select-box inline">
                        {{--订单状态1新订单 2付款 3发货 4完成 5退货中 6退货完成--}}
                        <select name="orderstatus" class="select">
                            <option value="">订单状态选择</option>
                            <option value="1">新订单</option>
                            <option value="2">已付款，待发货</option>
                            <option value="3">已发货，待签收</option>
                            <option value="4">完成</option>
                            <option value="5">退货中</option>
                            <option value="6">退货完成</option>
                        </select>
                    </span>

                    <input type="text" name="keyword" id="" placeholder=" 订单号，支持模糊匹配" style="width:250px"
                           class="input-text">
                    <button class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i> 搜订单
                    </button>
                </form>
            </div>
            <div class="cl pd-5 bg-1 bk-gray mt-20">
				<span class="l">

				</span>
                <span class="r">共有数据：<strong>{{ $orderDatas->total() }}</strong> 条</span>
            </div>
            <div class="mt-20">
                <table class="table table-border table-bordered table-bg table-hover table-sort">
                    <thead>
                    <tr class="text-c">
                        <th width="80">订单号</th>
                        <th width="80">总价(元)</th>
                        <th width="80">支付方式</th>
                        <th width="75">订单状态</th>
                        <th width="120">下单时间</th>
                        <th width="120">操作</th>
                    </tr>
                    </thead>
                    <tbody>

                    @foreach($orderDatas as $orderData)
                        <tr class="text-c">
                            <td>{{$orderData['no']}}</td>
                            <td>
                                {{$orderData['allprice']}}
                            </td>

                            <td>
                                @switch($orderData['paytype'])
                                    @case(1)
                                    <span class="label label-success radius"> 支付宝</span>
                                    @break
                                    @case(2)
                                    <span class="label label-danger radius"> 微信</span>
                                    @break
                                    @default
                                    dont't konw
                                @endswitch
                            </td>
                            <td>
                                {{--订单状态1新订单 2付款 3发货 4完成 5退货--}}
                                @switch($orderData['orderstatus'])
                                    @case(1)
                                    <span class="label label-success radius">  新订单</span>
                                    @break

                                    @case(2)
                                    <span class="label label-danger radius">   已付款</span>
                                    @break

                                    @case(3)
                                    <span class="label label-warning radius">  发货</span>
                                    @break

                                    @case(4)
                                    完成
                                    @break

                                    @case(5)
                                    <span class="label label-info radius">  发起退货中</span>
                                    @break

                                    @case(6)
                                    <span class="label label-info radius">  退货完成</span>
                                    @break


                                @endswitch

                            </td>
                            <td class="td-status">{{$orderData['created_at']}}</td>
                            <td class="f-14 td-manage">
                                <a style="text-decoration:none" class="ml-5"
                                   onClick=" " href="/admin/orderdetails/{{$orderData['id']}}">
                                    <i class="Hui-iconfont">&#xe6df;</i> 订单操作
                                </a>

                            </td>
                        </tr>

                    @endforeach

                    </tbody>
                </table>
            </div>
            <style>
                .page {
                    text-align: center;
                    padding: 10px;
                }

                .page ul li {
                    float: left;
                    padding: 5px 10px;
                    color: dodgerblue;
                    border: 1px dodgerblue solid;
                    border-radius: 5px;
                    margin-left: 5px;
                }

                .page ul li a {
                    padding: 5px;
                }
            </style>
            <div class="page">

                {{ $orderDatas->links() }}
            </div>
        </article>
    </div>



@endsection

@section('script')

    <!--请在下方写此页面业务相关的脚本-->
    <script type="text/javascript" src="/admi/lib/My97DatePicker/4.8/WdatePicker.js"></script>
    <script type="text/javascript" src="/admi/lib/laypage/1.2/laypage.js"></script>
    <script type="text/javascript">
        $(function () {


        })
    </script>
    <!--/请在上方写此页面业务相关的脚本-->


@endsection

